package com.huike.clues.service.impl;

import com.huike.clues.mapper.SysDictDataMapper;
import com.huike.common.core.domain.entity.SysDictData;
import com.huike.clues.service.ISysDictDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: fwh
 * @Date: 2023/07/11/15:58
 * @Description:
 */
@Slf4j
@Service
public class SysDictDataServiceImpl implements ISysDictDataService {
    @Resource
    private SysDictDataMapper sysDictDataMapper;

    /**
     * 新增字典
     *
     * @param sysDictData
     */
    @Override
    public void add(SysDictData sysDictData) {
        sysDictDataMapper.insert(sysDictData);
    }

    /**
     * 修改字典
     *
     * @param sysDictData
     */
    @Override
    public void update(SysDictData sysDictData) {
        sysDictDataMapper.update(sysDictData);
    }

    /**
     * 根据字典类型查询字典数据信息
     *
     * @param dictType
     * @return
     */
    @Override
    public List<SysDictData> select(String dictType) {
        return sysDictDataMapper.select(dictType);
    }

    /**
     * 查询字典数据详细
     *
     * @param dictCode
     * @return
     */
    @Override
    public SysDictData selectDictCode(Integer dictCode) {
        return sysDictDataMapper.selectDictCode(dictCode);
    }

    /**
     * 批量删除字典类型
     *
     * @param dictCodes
     */
    @Override
    public void delect(Integer dictCodes) {
        sysDictDataMapper.delect(dictCodes);
    }
    /**
     * 字典列表
     *
     * @param list
     * @return
     */
    @Override
    public List<SysDictData> selectList(SysDictData list) {
        return sysDictDataMapper.selectList(list);
    }

    /**
     * 字典导出
     * @param sysDictData
     * @return
     */
    @Override
    public List<SysDictData> selectDictDataList(SysDictData sysDictData) {
        return sysDictDataMapper.selectDictDataList(sysDictData);
    }
}
